using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CollegeShop.Infrastructure.Entities.Repository;

namespace CollegeShop.Infrastructure.Entities.Entity
{
    public class Provider : IAccessible<T_Provider, Provider>, ILogicEntity<T_Provider, Provider>
    {
        public int ID { get; set; }

        public string ProviderName { get; set; }

        public string ProviderNamePY { get; set; }

        public string LinkMan { get; set; }

        public string LinkPhone { get; set; }

        public string Remark { get; set; }

        protected override void Covariant(T_Provider model)
        {
            if (model != null)
            {
                    this.ID = model.ID;
                    this.ProviderName = model.ProviderName;
                    this.ProviderNamePY = model.ProviderNamePY;
                    this.LinkMan = model.LinkMan;
                    this.LinkPhone = model.LinkPhone;
                    this.Remark = model.Remark;
            }
}
        protected override T_Provider Inverter(Provider model)
        {
            if (model != null)
            {
                return new T_Provider()
                {
                    ID = model.ID,
                    ProviderName = model.ProviderName,
                    ProviderNamePY = model.ProviderNamePY,
                    LinkMan = model.LinkMan,
                    LinkPhone = model.LinkPhone,
                    Remark = model.Remark,
                };
            }
            return null;
        }
        public Provider Set(T_Provider dbModel)
        {
            Covariant(dbModel);
            return this;
        }
    }
}
